home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / InputSprocket.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  29.2 KB  |  1,043 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        InputSprocket.a
  3. ;
  4. ;    Contains:    Games Sprockets: InputSprocket interfaaces
  5. ;
  6. ;    Version:    Technology:    Input Sprocket 1.3
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__INPUTSPROCKET__') = 'UNDEFINED' THEN
  18. __INPUTSPROCKET__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  24.     include 'Events.a'
  25.     ENDIF
  26.  
  27.     IF &TYPE('USE_OLD_INPUT_SPROCKET_LABELS') = 'UNDEFINED' THEN
  28.     USE_OLD_INPUT_SPROCKET_LABELS: SET 0
  29.     ENDIF
  30.     IF &TYPE('USE_OLD_ISPNEED_STRUCT') = 'UNDEFINED' THEN
  31.     USE_OLD_ISPNEED_STRUCT: SET 0
  32.     ENDIF
  33. ;  ********************* data types ********************* 
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. ;  ISpDeviceClass is a general classs of device, example: keyboard, mouse, joystick 
  41. ; typedef OSType                         ISpDeviceClass
  42.  
  43. ;  ISpDeviceIdentifier is a specific device,  example: standard 1-button mouse, 105key ext. kbd. 
  44. ; typedef OSType                         ISpDeviceIdentifier
  45.  
  46. ; typedef OSType                         ISpElementLabel
  47.  
  48. ; typedef OSType                         ISpElementKind
  49.  
  50.  
  51. ;  *************** errors -30420 to -30439***************** 
  52.  
  53. kISpInternalErr                    EQU        -30420
  54. kISpSystemListErr                EQU        -30421
  55. kISpBufferToSmallErr            EQU        -30422
  56. kISpElementInListErr            EQU        -30423
  57. kISpElementNotInListErr            EQU        -30424
  58. kISpSystemInactiveErr            EQU        -30425
  59. kISpDeviceInactiveErr            EQU        -30426
  60. kISpSystemActiveErr                EQU        -30427
  61. kISpDeviceActiveErr                EQU        -30428
  62. kISpListBusyErr                    EQU        -30429
  63. ;  *************** resources **************** 
  64.  
  65. kISpApplicationResourceType        EQU        'isap'
  66. kISpSetListResourceType            EQU        'setl'
  67. kISpSetDataResourceType            EQU        'setd'
  68. ISpApplicationResourceStruct RECORD 0
  69. flags                     ds.l    1                ; offset: $0 (0)
  70. reserved1                 ds.l    1                ; offset: $4 (4)
  71. reserved2                 ds.l    1                ; offset: $8 (8)
  72. reserved3                 ds.l    1                ; offset: $C (12)
  73. sizeof                     EQU *                    ; size:   $10 (16)
  74.                         ENDR
  75.  
  76. kISpAppResFlag_UsesInputSprocket EQU    $00000001            ; true if the application uses InputSprocket
  77. kISpAppResFlag_UsesISpInit        EQU        $00000002            ; true if the calls ISpInit (ie, uses the high level interface, calls ISpConfigure, has a needs list, etc...)
  78. ; * ISpDeviceDefinition
  79. ; *
  80. ; * This structure provides all the available
  81. ; * information for an input device within the system
  82. ; *
  83.  
  84. ISpDeviceDefinition        RECORD 0
  85. deviceName                 ds        Str63            ; offset: $0 (0)        ;  a human readable name of the device 
  86. theDeviceClass             ds.l    1                ; offset: $40 (64)        ;  general classs of device example : keyboard, mouse, joystick 
  87. theDeviceIdentifier         ds.l    1                ; offset: $44 (68)        ;  every distinguishable device should have an OSType 
  88. permanentID                 ds.l    1                ; offset: $48 (72)        ;  a cross reboot id unique within that deviceType, 0 if not possible 
  89. flags                     ds.l    1                ; offset: $4C (76)        ;  status flags 
  90. reserved1                 ds.l    1                ; offset: $50 (80)
  91. reserved2                 ds.l    1                ; offset: $54 (84)
  92. reserved3                 ds.l    1                ; offset: $58 (88)
  93. sizeof                     EQU *                    ; size:   $5C (92)
  94.                         ENDR
  95.  
  96. kISpDeviceFlag_HandleOwnEmulation EQU    1
  97. ; * ISpElementEvent, ISpElementEventPtr
  98. ; *
  99. ; * This is the structure that event data is passed in.
  100. ; *
  101.  
  102. ISpElementEvent            RECORD 0
  103. when                     ds        AbsoluteTime    ; offset: $0 (0)        ;  this is absolute time on PCI or later, otherwise it is 
  104. ;  0 for the hi 32 bits and TickCount for the low 32 bits 
  105. element                     ds.l    1                ; offset: $8 (8)        ;  a reference to the element that generated this event 
  106. refCon                     ds.l    1                ; offset: $C (12)        ;  for application usage, 0 on the global list 
  107. data                     ds.l    1                ; offset: $10 (16)        ;  the data for this event 
  108. sizeof                     EQU *                    ; size:   $14 (20)
  109.                         ENDR
  110. ; typedef struct ISpElementEvent *        ISpElementEventPtr
  111.  
  112. ; * ISpElementInfo, ISpElementInfoPtr
  113. ; *
  114. ; * This is the generic definition of an element.
  115. ; * Every element must contain this information.
  116. ; *
  117.  
  118. ISpElementInfo            RECORD 0
  119. theLabel                 ds.l    1                ; offset: $0 (0)
  120. theKind                     ds.l    1                ; offset: $4 (4)
  121. theString                 ds        Str63            ; offset: $8 (8)
  122. reserved1                 ds.l    1                ; offset: $48 (72)
  123. reserved2                 ds.l    1                ; offset: $4C (76)
  124. sizeof                     EQU *                    ; size:   $50 (80)
  125.                         ENDR
  126. ; typedef struct ISpElementInfo *        ISpElementInfoPtr
  127.  
  128. ; typedef UInt32                         ISpNeedFlagBits
  129.  
  130.     IF USE_OLD_ISPNEED_STRUCT THEN
  131. ISpNeed                    RECORD 0
  132. name                     ds        Str63            ; offset: $0 (0)
  133. iconSuiteResourceId         ds.w    1                ; offset: $40 (64)        ;  resource id of the icon suite 
  134. reserved                 ds.w    1                ; offset: $42 (66)
  135. theKind                     ds.l    1                ; offset: $44 (68)
  136. theLabel                 ds.l    1                ; offset: $48 (72)
  137. flags                     ds.l    1                ; offset: $4C (76)
  138. reserved1                 ds.l    1                ; offset: $50 (80)
  139. reserved2                 ds.l    1                ; offset: $54 (84)
  140. reserved3                 ds.l    1                ; offset: $58 (88)
  141. sizeof                     EQU *                    ; size:   $5C (92)
  142.                         ENDR
  143.     ELSE
  144. ISpNeed                    RECORD 0
  145. name                     ds        Str63            ; offset: $0 (0)        ;  human-readable string 
  146. iconSuiteResourceId         ds.w    1                ; offset: $40 (64)        ;  resource id of the icon suite 
  147. playerNum                 ds.b    1                ; offset: $42 (66)        ;  used for multi-player support 
  148. group                     ds.b    1                ; offset: $43 (67)        ;  used to group related needs (eg, look left and look right button needs) 
  149. theKind                     ds.l    1                ; offset: $44 (68)
  150. theLabel                 ds.l    1                ; offset: $48 (72)
  151. flags                     ds.l    1                ; offset: $4C (76)
  152. reserved1                 ds.l    1                ; offset: $50 (80)
  153. reserved2                 ds.l    1                ; offset: $54 (84)
  154. reserved3                 ds.l    1                ; offset: $58 (88)
  155. sizeof                     EQU *                    ; size:   $5C (92)
  156.                         ENDR
  157.     ENDIF    ; USE_OLD_ISPNEED_STRUCT
  158.  
  159. kISpNeedFlag_NoMultiConfig        EQU        $00000001            ; once this need is autoconfigured to one device dont autoconfigure to anything else
  160. kISpNeedFlag_Utility            EQU        $00000002            ; this need is a utility function (like show framerate) which would not typically be assigned to anything but the keyboard
  161. kISpNeedFlag_PolledOnly            EQU        $00000004
  162. kISpNeedFlag_EventsOnly            EQU        $00000008            ; *** kISpElementKind specific flags ***
  163.                                                             ; these are flags specific to kISpElementKind_Button
  164. kISpNeedFlag_Button_AlreadyAxis    EQU        $10000000            ; there is a axis version of this button need
  165. kISpNeedFlag_Button_ClickToggles EQU    $20000000
  166. kISpNeedFlag_Button_ActiveWhenDown EQU    $40000000
  167. kISpNeedFlag_Button_AlreadyDelta EQU    $80000000            ; there is a delta version of this button need
  168.                                                             ; these are flags specific to kISpElementKind_DPad
  169.                                                             ; these are flags specific to kISpElementKind_Axis
  170. kISpNeedFlag_Axis_AlreadyButton    EQU        $10000000            ; there is a button version of this axis need
  171. kISpNeedFlag_Axis_Asymetric        EQU        $20000000            ; this axis need is asymetric    
  172. kISpNeedFlag_Axis_AlreadyDelta    EQU        $40000000            ; there is a delta version of this axis need
  173.                                                             ; these are flags specific to kISpElementKind_Delta
  174. kISpNeedFlag_Delta_AlreadyAxis    EQU        $10000000            ; there is a axis version of this delta need
  175. kISpNeedFlag_Delta_AlreadyButton EQU    $20000000            ; there is a button version of this delta need
  176. ; *
  177. ; * These are the current built values for ISpDeviceClass
  178. ; *
  179.  
  180.  
  181. kISpDeviceClass_SpeechRecognition EQU    'talk'
  182. kISpDeviceClass_Mouse            EQU        'mous'
  183. kISpDeviceClass_Keyboard        EQU        'keyd'
  184. kISpDeviceClass_Joystick        EQU        'joys'
  185. kISpDeviceClass_Wheel            EQU        'whel'
  186. kISpDeviceClass_Pedals            EQU        'pedl'
  187. kISpDeviceClass_Levers            EQU        'levr'
  188. kISpDeviceClass_Tickle            EQU        'tckl'                ; a device of this class requires ISpTickle
  189. kISpDeviceClass_Unknown            EQU        '????'
  190. ; * These are the current built in ISpElementKind's
  191. ; * 
  192. ; * These are all OSTypes.
  193. ; *
  194.  
  195.  
  196. kISpElementKind_Button            EQU        'butn'
  197. kISpElementKind_DPad            EQU        'dpad'
  198. kISpElementKind_Axis            EQU        'axis'
  199. kISpElementKind_Delta            EQU        'dlta'
  200. kISpElementKind_Movement        EQU        'move'
  201. kISpElementKind_Virtual            EQU        'virt'
  202.  
  203. ; *
  204. ; * These are the current built in ISpElementLabel's
  205. ; *
  206. ; * These are all OSTypes.
  207. ; *
  208.  
  209.     IF USE_OLD_INPUT_SPROCKET_LABELS THEN
  210.  
  211.                                                             ; axis 
  212. kISpElementLabel_XAxis            EQU        'xaxi'
  213. kISpElementLabel_YAxis            EQU        'yaxi'
  214. kISpElementLabel_ZAxis            EQU        'zaxi'
  215. kISpElementLabel_Rx                EQU        'rxax'
  216. kISpElementLabel_Ry                EQU        'ryax'
  217. kISpElementLabel_Rz                EQU        'rzax'
  218. kISpElementLabel_Gas            EQU        'gasp'
  219. kISpElementLabel_Brake            EQU        'brak'
  220. kISpElementLabel_Clutch            EQU        'cltc'
  221. kISpElementLabel_Throttle        EQU        'thrt'
  222. kISpElementLabel_Trim            EQU        'trim'                ; direction pad 
  223. kISpElementLabel_POVHat            EQU        'povh'
  224. kISpElementLabel_PadMove        EQU        'move'                ; buttons 
  225. kISpElementLabel_Fire            EQU        'fire'
  226. kISpElementLabel_Start            EQU        'strt'
  227. kISpElementLabel_Select            EQU        'optn'
  228.     ENDIF    ; USE_OLD_INPUT_SPROCKET_LABELS
  229.  
  230.                                                             ; generic 
  231. kISpElementLabel_None            EQU        'none'                ; axis 
  232. kISpElementLabel_Axis_XAxis        EQU        'xaxi'
  233. kISpElementLabel_Axis_YAxis        EQU        'yaxi'
  234. kISpElementLabel_Axis_ZAxis        EQU        'zaxi'
  235. kISpElementLabel_Axis_Rx        EQU        'rxax'
  236. kISpElementLabel_Axis_Ry        EQU        'ryax'
  237. kISpElementLabel_Axis_Rz        EQU        'rzax'
  238. kISpElementLabel_Axis_Roll        EQU        'rzax'
  239. kISpElementLabel_Axis_Pitch        EQU        'rxax'
  240. kISpElementLabel_Axis_Yaw        EQU        'ryax'
  241. kISpElementLabel_Axis_RollTrim    EQU        'rxtm'
  242. kISpElementLabel_Axis_PitchTrim    EQU        'trim'
  243. kISpElementLabel_Axis_YawTrim    EQU        'rytm'
  244. kISpElementLabel_Axis_Gas        EQU        'gasp'
  245. kISpElementLabel_Axis_Brake        EQU        'brak'
  246. kISpElementLabel_Axis_Clutch    EQU        'cltc'
  247. kISpElementLabel_Axis_Throttle    EQU        'thrt'
  248. kISpElementLabel_Axis_Trim        EQU        'trim'
  249. kISpElementLabel_Axis_Rudder    EQU        'rudd'                ; delta 
  250. kISpElementLabel_Delta_X        EQU        'xdlt'
  251. kISpElementLabel_Delta_Y        EQU        'ydlt'
  252. kISpElementLabel_Delta_Z        EQU        'zdlt'
  253. kISpElementLabel_Delta_Rx        EQU        'rxdl'
  254. kISpElementLabel_Delta_Ry        EQU        'rydl'
  255. kISpElementLabel_Delta_Rz        EQU        'rzdl'
  256. kISpElementLabel_Delta_Roll        EQU        'rzdl'
  257. kISpElementLabel_Delta_Pitch    EQU        'rxdl'
  258. kISpElementLabel_Delta_Yaw        EQU        'rydl'                ; direction pad 
  259. kISpElementLabel_Pad_POV        EQU        'povh'                ; up/down/left/right
  260. kISpElementLabel_Pad_Move        EQU        'move'                ; up/down/left/right
  261. kISpElementLabel_Pad_POV_Horiz    EQU        'hpov'                ; forward/back/left/right
  262. kISpElementLabel_Pad_Move_Horiz    EQU        'hmov'                ; forward/back/left/right
  263.                                                             ; buttons 
  264. kISpElementLabel_Btn_Fire        EQU        'fire'
  265. kISpElementLabel_Btn_SecondaryFire EQU    'sfir'
  266. kISpElementLabel_Btn_Jump        EQU        'jump'
  267. kISpElementLabel_Btn_PauseResume EQU    'strt'                ; kISpElementLabel_Btn_PauseResume automatically binds to escape 
  268. kISpElementLabel_Btn_Select        EQU        'optn'
  269. kISpElementLabel_Btn_SlideLeft    EQU        'blft'
  270. kISpElementLabel_Btn_SlideRight    EQU        'brgt'
  271. kISpElementLabel_Btn_MoveForward EQU    'btmf'
  272. kISpElementLabel_Btn_MoveBackward EQU    'btmb'
  273. kISpElementLabel_Btn_TurnLeft    EQU        'bttl'
  274. kISpElementLabel_Btn_TurnRight    EQU        'bttr'
  275. kISpElementLabel_Btn_LookLeft    EQU        'btll'
  276. kISpElementLabel_Btn_LookRight    EQU        'btlr'
  277. kISpElementLabel_Btn_LookUp        EQU        'btlu'
  278. kISpElementLabel_Btn_LookDown    EQU        'btld'
  279. kISpElementLabel_Btn_Next        EQU        'btnx'
  280. kISpElementLabel_Btn_Previous    EQU        'btpv'
  281. kISpElementLabel_Btn_SideStep    EQU        'side'
  282. kISpElementLabel_Btn_Run        EQU        'quik'
  283. kISpElementLabel_Btn_Look        EQU        'blok'
  284. ; *
  285. ; * direction pad data & configuration information
  286. ; *
  287.  
  288. ; typedef UInt32                         ISpDPadData
  289.  
  290.  
  291. kISpPadIdle                        EQU        0
  292. kISpPadLeft                        EQU        1
  293. kISpPadUpLeft                    EQU        2
  294. kISpPadUp                        EQU        3
  295. kISpPadUpRight                    EQU        4
  296. kISpPadRight                    EQU        5
  297. kISpPadDownRight                EQU        6
  298. kISpPadDown                        EQU        7
  299. kISpPadDownLeft                    EQU        8
  300. ISpDPadConfigurationInfo RECORD 0
  301. id                         ds.l    1                ; offset: $0 (0)        ;  ordering 1..n, 0 = no relavent ordering of direction pads 
  302. fourWayPad                 ds.b    1                ; offset: $4 (4)        ;  true if this pad can only produce idle + four directions 
  303.                          ORG 6
  304. sizeof                     EQU *                    ; size:   $6 (6)
  305.                         ENDR
  306. ; *
  307. ; * button data & configuration information
  308. ; *
  309.  
  310. ; typedef UInt32                         ISpButtonData
  311.  
  312.  
  313. kISpButtonUp                    EQU        0
  314. kISpButtonDown                    EQU        1
  315. ISpButtonConfigurationInfo RECORD 0
  316. id                         ds.l    1                ; offset: $0 (0)        ;  ordering 1..n, 0 = no relavent ordering of buttons 
  317. sizeof                     EQU *                    ; size:   $4 (4)
  318.                         ENDR
  319. ; *
  320. ; * axis data & configuration information 
  321. ; *
  322.  
  323. ; typedef UInt32                         ISpAxisData
  324.  
  325. ISpAxisConfigurationInfo RECORD 0
  326. symetricAxis             ds.b    1                ; offset: $0 (0)        ;  axis is symetric, i.e. a joystick is symetric and a gas pedal is not 
  327.                          ORG 2
  328. sizeof                     EQU *                    ; size:   $2 (2)
  329.                         ENDR
  330. ; typedef Fixed                         ISpDeltaData
  331.  
  332. ISpDeltaConfigurationInfo RECORD 0
  333. reserved1                 ds.l    1                ; offset: $0 (0)
  334. reserved2                 ds.l    1                ; offset: $4 (4)
  335. sizeof                     EQU *                    ; size:   $8 (8)
  336.                         ENDR
  337. ISpMovementData            RECORD 0
  338. xAxis                     ds.l    1                ; offset: $0 (0)
  339. yAxis                     ds.l    1                ; offset: $4 (4)
  340. direction                 ds.l    1                ; offset: $8 (8)        ;  ISpDPadData version of the movement 
  341. sizeof                     EQU *                    ; size:   $C (12)
  342.                         ENDR
  343. ISpMovementConfigurationInfo RECORD 0
  344. reserved1                 ds.l    1                ; offset: $0 (0)
  345. reserved2                 ds.l    1                ; offset: $4 (4)
  346. sizeof                     EQU *                    ; size:   $8 (8)
  347.                         ENDR
  348.  
  349. kISpVirtualElementFlag_UseTempMem EQU    1
  350.  
  351. kISpElementListFlag_UseTempMem    EQU        1
  352.  
  353. kISpFirstIconSuite                EQU        30000
  354. kISpLastIconSuite                EQU        30100
  355. kISpNoneIconSuite                EQU        30000
  356.  
  357.     IF TARGET_RT_MAC_CFM THEN
  358. ;  ********************* user level functions ********************* 
  359. ; *
  360. ; * startup / shutdown
  361. ; *
  362.  
  363. ;
  364. ; extern OSStatus ISpStartup(void )
  365. ;
  366.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  367.         IMPORT_CFM_FUNCTION ISpStartup
  368.     ENDIF
  369.  
  370. ;  1.1 or later
  371. ;
  372. ; extern OSStatus ISpShutdown(void )
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  375.         IMPORT_CFM_FUNCTION ISpShutdown
  376.     ENDIF
  377.  
  378. ;  1.1 or later
  379. ; *
  380. ; * polling
  381. ; *
  382.  
  383. ;
  384. ; extern OSStatus ISpTickle(void )
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION ISpTickle
  388.     ENDIF
  389.  
  390. ;  1.1 or later
  391. ; ********** user interface functions *********
  392.  
  393. ;
  394. ; extern NumVersion ISpGetVersion(void )
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  397.         IMPORT_CFM_FUNCTION ISpGetVersion
  398.     ENDIF
  399.  
  400. ; *
  401. ; * ISpElement_NewVirtual(ISpElementReference *outElement);
  402. ; *
  403.  
  404. ;
  405. ; extern OSStatus ISpElement_NewVirtual(UInt32 dataSize, ISpElementReference *outElement, UInt32 flags)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION ISpElement_NewVirtual
  409.     ENDIF
  410.  
  411. ; *
  412. ; * ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeeds *needs, ISpElementReference *outElements);
  413. ; *
  414.  
  415. ;
  416. ; extern OSStatus ISpElement_NewVirtualFromNeeds(UInt32 count, ISpNeed *needs, ISpElementReference *outElements, UInt32 flags)
  417. ;
  418.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  419.         IMPORT_CFM_FUNCTION ISpElement_NewVirtualFromNeeds
  420.     ENDIF
  421.  
  422. ; *
  423. ; * ISpElement_DisposeVirtual(inElement);
  424. ; *
  425.  
  426. ;
  427. ; extern OSStatus ISpElement_DisposeVirtual(UInt32 count, ISpElementReference *inElements)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION ISpElement_DisposeVirtual
  431.     ENDIF
  432.  
  433. ; * ISpInit
  434. ; *
  435.  
  436. ;
  437. ; extern OSStatus ISpInit(UInt32 count, ISpNeed *needs, ISpElementReference *inReferences, OSType appCreatorCode, OSType subCreatorCode, UInt32 flags, short setListResourceId, UInt32 reserved)
  438. ;
  439.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  440.         IMPORT_CFM_FUNCTION ISpInit
  441.     ENDIF
  442.  
  443.  
  444. ; * ISpConfigure
  445. ; *
  446.  
  447. ;
  448. ; extern OSStatus ISpConfigure(ISpEventProcPtr inEventProcPtr)
  449. ;
  450.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  451.         IMPORT_CFM_FUNCTION ISpConfigure
  452.     ENDIF
  453.  
  454. ; *
  455. ; * ISpStop
  456. ; *
  457.  
  458. ;
  459. ; extern OSStatus ISpStop(void )
  460. ;
  461.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  462.         IMPORT_CFM_FUNCTION ISpStop
  463.     ENDIF
  464.  
  465. ; *
  466. ; * ISpSuspend, ISpResume
  467. ; *
  468. ; * ISpSuspend turns all devices off and allocates memory so that the state may be later resumed.
  469. ; * ISpResume resumes to the previous state of the system after a suspend call.
  470. ; * 
  471. ; * Return Codes
  472. ; * memFullErr
  473. ; *
  474.  
  475. ;
  476. ; extern OSStatus ISpSuspend(void )
  477. ;
  478.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  479.         IMPORT_CFM_FUNCTION ISpSuspend
  480.     ENDIF
  481.  
  482. ;
  483. ; extern OSStatus ISpResume(void )
  484. ;
  485.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  486.         IMPORT_CFM_FUNCTION ISpResume
  487.     ENDIF
  488.  
  489. ; * ISpDevices_Extract, ISpDevices_ExtractByClass, ISpDevices_ExtractByIdentifier
  490. ; *
  491. ; * These will extract as many device references from the system wide list as will fit in your buffer.  
  492. ; *
  493. ; * inBufferCount - the size of your buffer (in units of sizeof(ISpDeviceReference)) this may be zero
  494. ; * buffer - a pointer to your buffer
  495. ; * outCount - contains the number of devices in the system
  496. ; *
  497. ; * ISpDevices_ExtractByClass extracts and counts devices of the specified ISpDeviceClass
  498. ; * ISpDevices_ExtractByIdentifier extracts and counts devices of the specified ISpDeviceIdentifier
  499. ; *
  500. ; * Return Codes
  501. ; * paramErr
  502. ; *
  503.  
  504. ;
  505. ; extern OSStatus ISpDevices_Extract(UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer)
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  508.         IMPORT_CFM_FUNCTION ISpDevices_Extract
  509.     ENDIF
  510.  
  511. ;
  512. ; extern OSStatus ISpDevices_ExtractByClass(ISpDeviceClass inClass, UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer)
  513. ;
  514.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  515.         IMPORT_CFM_FUNCTION ISpDevices_ExtractByClass
  516.     ENDIF
  517.  
  518. ;
  519. ; extern OSStatus ISpDevices_ExtractByIdentifier(ISpDeviceIdentifier inIdentifier, UInt32 inBufferCount, UInt32 *outCount, ISpDeviceReference *buffer)
  520. ;
  521.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  522.         IMPORT_CFM_FUNCTION ISpDevices_ExtractByIdentifier
  523.     ENDIF
  524.  
  525.  
  526. ; * ISpDevices_ActivateClass, ISpDevices_DeactivateClass, ISpDevices_Activate, ISpDevices_Deactivate, ISpDevice_IsActive
  527. ; *
  528. ; * ISpDevices_Activate, ISpDevices_Deactivate
  529. ; *
  530. ; * This will activate/deactivate a block of devices.
  531. ; * inDeviceCount - the number of devices to activate / deactivate
  532. ; * inDevicesToActivate/inDevicesToDeactivate - a pointer to a block of memory contains the devices references
  533. ; *
  534. ; * ISpDevices_ActivateClass, ISpDevices_DeactivateClass
  535. ; * inClass - the class of devices to activate or deactivate
  536. ; *
  537. ; * ISpDevice_IsActive
  538. ; * inDevice - the device reference that you wish to 
  539. ; * outIsActive - a boolean value that is true when the device is active
  540. ; *
  541. ; * Return Codes
  542. ; * paramErr
  543. ; *
  544.  
  545. ;
  546. ; extern OSStatus ISpDevices_ActivateClass(ISpDeviceClass inClass)
  547. ;
  548.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  549.         IMPORT_CFM_FUNCTION ISpDevices_ActivateClass
  550.     ENDIF
  551.  
  552. ;  1.1 or later
  553. ;
  554. ; extern OSStatus ISpDevices_DeactivateClass(ISpDeviceClass inClass)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION ISpDevices_DeactivateClass
  558.     ENDIF
  559.  
  560. ;  1.1 or later
  561. ;
  562. ; extern OSStatus ISpDevices_Activate(UInt32 inDeviceCount, ISpDeviceReference *inDevicesToActivate)
  563. ;
  564.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  565.         IMPORT_CFM_FUNCTION ISpDevices_Activate
  566.     ENDIF
  567.  
  568. ;
  569. ; extern OSStatus ISpDevices_Deactivate(UInt32 inDeviceCount, ISpDeviceReference *inDevicesToDeactivate)
  570. ;
  571.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  572.         IMPORT_CFM_FUNCTION ISpDevices_Deactivate
  573.     ENDIF
  574.  
  575. ;
  576. ; extern OSStatus ISpDevice_IsActive(ISpDeviceReference inDevice, Boolean *outIsActive)
  577. ;
  578.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION ISpDevice_IsActive
  580.     ENDIF
  581.  
  582. ; * ISpDevice_GetDefinition
  583. ; *
  584. ; *
  585. ; * inDevice - the device you want to get the definition for
  586. ; * inBuflen - the size of the structure (sizeof(ISpDeviceDefinition))
  587. ; * outStruct - a pointer to where you want the structure copied
  588. ; *
  589. ; * Return Codes
  590. ; * paramErr
  591. ; *
  592.  
  593. ;
  594. ; extern OSStatus ISpDevice_GetDefinition(ISpDeviceReference inDevice, UInt32 inBuflen, ISpDeviceDefinition *outStruct)
  595. ;
  596.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  597.         IMPORT_CFM_FUNCTION ISpDevice_GetDefinition
  598.     ENDIF
  599.  
  600.  
  601. ; *
  602. ; * ISpDevice_GetElementList
  603. ; *
  604. ; * inDevice - the device whose element list you wish to get
  605. ; * outElementList - a pointer to where you want a reference to that list stored
  606. ; *
  607. ; * Return Codes
  608. ; * paramErr
  609. ; *
  610.  
  611. ;
  612. ; extern OSStatus ISpDevice_GetElementList(ISpDeviceReference inDevice, ISpElementListReference *outElementList)
  613. ;
  614.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  615.         IMPORT_CFM_FUNCTION ISpDevice_GetElementList
  616.     ENDIF
  617.  
  618. ; *
  619. ; * takes an ISpElementReference and returns the group that it is in or 0 if there is
  620. ; * no group
  621. ; *
  622. ; * Return Codes
  623. ; * paramErr
  624. ; *
  625.  
  626. ;
  627. ; extern OSStatus ISpElement_GetGroup(ISpElementReference inElement, UInt32 *outGroup)
  628. ;
  629.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  630.         IMPORT_CFM_FUNCTION ISpElement_GetGroup
  631.     ENDIF
  632.  
  633. ; *
  634. ; * takes an ISpElementReference and returns the device that the element belongs 
  635. ; * to.
  636. ; *
  637. ; * Return Codes
  638. ; * paramErr if inElement is 0 or outDevice is nil
  639. ; *
  640.  
  641. ;
  642. ; extern OSStatus ISpElement_GetDevice(ISpElementReference inElement, ISpDeviceReference *outDevice)
  643. ;
  644.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  645.         IMPORT_CFM_FUNCTION ISpElement_GetDevice
  646.     ENDIF
  647.  
  648. ; *
  649. ; * takes an ISpElementReference and gives the ISpElementInfo for that Element.  This is the
  650. ; * the set of standard information.  You get ISpElementKind specific information
  651. ; * through ISpElement_GetConfigurationInfo.
  652. ; *
  653. ; * Return Codes
  654. ; * paramErr if inElement is 0 or outInfo is nil
  655. ; *
  656.  
  657. ;
  658. ; extern OSStatus ISpElement_GetInfo(ISpElementReference inElement, ISpElementInfoPtr outInfo)
  659. ;
  660.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  661.         IMPORT_CFM_FUNCTION ISpElement_GetInfo
  662.     ENDIF
  663.  
  664. ; *
  665. ; *         
  666. ; *
  667. ; * takes an ISpElementReference and gives the ISpElementKind specific configuration information
  668. ; * 
  669. ; * if buflen is not long enough to hold the information ISpElement_GetConfigurationInfo will
  670. ; * copy buflen bytes of the data into the block of memory pointed to by configInfo and
  671. ; * will return something error.
  672. ; *
  673. ; * Return Codes
  674. ; * paramErr if inElement or configInfo is nil
  675. ; *
  676.  
  677. ;
  678. ; extern OSStatus ISpElement_GetConfigurationInfo(ISpElementReference inElement, UInt32 buflen, void *configInfo)
  679. ;
  680.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  681.         IMPORT_CFM_FUNCTION ISpElement_GetConfigurationInfo
  682.     ENDIF
  683.  
  684. ; *
  685. ; * ISpElement_GetSimpleState
  686. ; *
  687. ; * Takes an ISpElementReference and returns the current state of that element.  This is a 
  688. ; * specialized version of ISpElement_GetComplexState that is only appropriate for elements
  689. ; * whose data fits in a signed 32 bit integer.
  690. ; *
  691. ; *
  692. ; *
  693. ; * Return Codes
  694. ; * paramErr if inElement is 0 or state is nil
  695. ; *
  696.  
  697. ;
  698. ; extern OSStatus ISpElement_GetSimpleState(ISpElementReference inElement, UInt32 *state)
  699. ;
  700.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  701.         IMPORT_CFM_FUNCTION ISpElement_GetSimpleState
  702.     ENDIF
  703.  
  704. ; *
  705. ; * ISpElement_GetComplexState
  706. ; *
  707. ; * Takes an ISpElementReference and returns the current state of that element.  
  708. ; * Will copy up to buflen bytes of the current state of the device into
  709. ; * state.
  710. ; *
  711. ; *
  712. ; * Return Codes
  713. ; * paramErr if inElement is 0 or state is nil
  714. ; *
  715.  
  716. ;
  717. ; extern OSStatus ISpElement_GetComplexState(ISpElementReference inElement, UInt32 buflen, void *state)
  718. ;
  719.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  720.         IMPORT_CFM_FUNCTION ISpElement_GetComplexState
  721.     ENDIF
  722.  
  723.  
  724. ; * ISpElement_GetNextEvent
  725. ; *
  726. ; * It takes in an element  reference and the buffer size of the ISpElementEventPtr
  727. ; * it will set wasEvent to true if there was an event and false otherwise.  If there
  728. ; * was not enough space to fill in the whole event structure that event will be
  729. ; * dequed, as much of the event as will fit in the buffer will by copied and
  730. ; * ISpElement_GetNextEvent will return an error.
  731. ; *
  732. ; * Return Codes
  733. ; * paramErr
  734. ; *
  735.  
  736. ;
  737. ; extern OSStatus ISpElement_GetNextEvent(ISpElementReference inElement, UInt32 bufSize, ISpElementEventPtr event, Boolean *wasEvent)
  738. ;
  739.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  740.         IMPORT_CFM_FUNCTION ISpElement_GetNextEvent
  741.     ENDIF
  742.  
  743. ; *
  744. ; * ISpElement_Flush
  745. ; *
  746. ; * It takes an ISpElementReference and flushes all the events on that element.  All it guaruntees is
  747. ; * that any events that made it to this layer before the time of the flush call will be flushed and
  748. ; * it will not flush any events that make it to this layer after the time when the call has returned.
  749. ; * What happens to events that occur during the flush is undefined.
  750. ; *
  751. ; *
  752. ; * Return Codes
  753. ; * paramErr
  754. ; *
  755.  
  756. ;
  757. ; extern OSStatus ISpElement_Flush(ISpElementReference inElement)
  758. ;
  759.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  760.         IMPORT_CFM_FUNCTION ISpElement_Flush
  761.     ENDIF
  762.  
  763.  
  764.  
  765. ; * ISpElementList_New
  766. ; *
  767. ; * Creates a new element list and returns it in outElementList.  In count specifies 
  768. ; * the number of element references in the list pointed to by inElements.  If inCount
  769. ; * is non zero the list is created with inCount elements in at as specified by the 
  770. ; * inElements parameter.  Otherwise the list is created empty.
  771. ; *
  772. ; *
  773. ; * Return Codes
  774. ; * out of memory - If it failed to allocate the list because it was out of memory
  775. ;                   it will also set outElementList to 0
  776. ; * paramErr if outElementList was nil
  777. ; *
  778. ; *
  779. ; * Special Concerns
  780. ; *
  781. ; * interrupt unsafe
  782. ; *
  783.  
  784. ;
  785. ; extern OSStatus ISpElementList_New(UInt32 inCount, ISpElementReference *inElements, ISpElementListReference *outElementList, UInt32 flags)
  786. ;
  787.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  788.         IMPORT_CFM_FUNCTION ISpElementList_New
  789.     ENDIF
  790.  
  791. ; * ISpElementList_Dispose
  792. ; *
  793. ; * Deletes an already existing memory list.  
  794. ; *
  795. ; *
  796. ; * Return Codes
  797. ; * paramErr if inElementList was 0
  798. ; *
  799. ; *
  800. ; * Special Concerns
  801. ; *
  802. ; * interrupt unsafe
  803. ; *
  804.  
  805. ;
  806. ; extern OSStatus ISpElementList_Dispose(ISpElementListReference inElementList)
  807. ;
  808.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  809.         IMPORT_CFM_FUNCTION ISpElementList_Dispose
  810.     ENDIF
  811.  
  812. ; * ISpGetGlobalElementList
  813. ; *
  814. ; * returns the global element list
  815. ; *
  816. ; * Return Codes
  817. ; * paramErr if outElementList is nil
  818. ; *
  819.  
  820. ;
  821. ; extern OSStatus ISpGetGlobalElementList(ISpElementListReference *outElementList)
  822. ;
  823.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  824.         IMPORT_CFM_FUNCTION ISpGetGlobalElementList
  825.     ENDIF
  826.  
  827. ; * ISpElementList_AddElement
  828. ; *
  829. ; * adds an element to the element list
  830. ; *
  831. ; * Return Codes
  832. ; * paramErr if inElementList is 0 or newElement is 0
  833. ; * memory error if the system is unable to allocate enough memory
  834. ; *
  835. ; * Special Concerns
  836. ; * interrupt Unsafe
  837. ; * 
  838.  
  839. ;
  840. ; extern OSStatus ISpElementList_AddElements(ISpElementListReference inElementList, UInt32 refCon, UInt32 count, ISpElementReference *newElements)
  841. ;
  842.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  843.         IMPORT_CFM_FUNCTION ISpElementList_AddElements
  844.     ENDIF
  845.  
  846. ; * ISpElementList_RemoveElement
  847. ; *
  848. ; * removes the specified element from the element list
  849. ; *
  850. ; * Return Codes
  851. ; * paramErr if inElementList is 0 or oldElement is 0
  852. ; * memory error if the system is unable to allocate enough memory
  853. ; *
  854. ; * Special Concerns
  855. ; * interrupt Unsafe
  856. ; * 
  857.  
  858. ;
  859. ; extern OSStatus ISpElementList_RemoveElements(ISpElementListReference inElementList, UInt32 count, ISpElementReference *oldElement)
  860. ;
  861.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  862.         IMPORT_CFM_FUNCTION ISpElementList_RemoveElements
  863.     ENDIF
  864.  
  865. ; * ISpElementList_Extract
  866. ; *
  867. ; * ISpElementList_Extract will extract as many of the elements from an element list as possible.  You pass
  868. ; * in an element list, a pointer to an array of element references and the number of elements in that array.
  869. ; * It will return how many items are in the element list in the outCount parameter and copy the minimum of 
  870. ; * that number and the size of the array into the buffer.
  871. ; *
  872. ; * ByKind and ByLabel are the same except that they will only count and copy element references to elements
  873. ; * that have the specified kind and label.
  874. ; *
  875. ; * Return Codes
  876. ; * paramErr
  877. ; *
  878.  
  879. ;
  880. ; extern OSStatus ISpElementList_Extract(ISpElementListReference inElementList, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer)
  881. ;
  882.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  883.         IMPORT_CFM_FUNCTION ISpElementList_Extract
  884.     ENDIF
  885.  
  886. ;
  887. ; extern OSStatus ISpElementList_ExtractByKind(ISpElementListReference inElementList, ISpElementKind inKind, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer)
  888. ;
  889.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  890.         IMPORT_CFM_FUNCTION ISpElementList_ExtractByKind
  891.     ENDIF
  892.  
  893. ;
  894. ; extern OSStatus ISpElementList_ExtractByLabel(ISpElementListReference inElementList, ISpElementLabel inLabel, UInt32 inBufferCount, UInt32 *outCount, ISpElementReference *buffer)
  895. ;
  896.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  897.         IMPORT_CFM_FUNCTION ISpElementList_ExtractByLabel
  898.     ENDIF
  899.  
  900. ; * ISpElementList_GetNextEvent
  901. ; *
  902. ; * It takes in an element list reference and the buffer size of the ISpElementEventPtr
  903. ; * it will set wasEvent to true if there was an event and false otherwise.  If there
  904. ; * was not enough space to fill in the whole event structure that event will be
  905. ; * dequed, as much of the event as will fit in the buffer will by copied and
  906. ; * ISpElementList_GetNextEvent will return an error.
  907. ; *
  908. ; * Return Codes
  909. ; * paramErr
  910. ; *
  911.  
  912. ;
  913. ; extern OSStatus ISpElementList_GetNextEvent(ISpElementListReference inElementList, UInt32 bufSize, ISpElementEventPtr event, Boolean *wasEvent)
  914. ;
  915.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  916.         IMPORT_CFM_FUNCTION ISpElementList_GetNextEvent
  917.     ENDIF
  918.  
  919. ; *
  920. ; * ISpElementList_Flush
  921. ; *
  922. ; * It takes an ISpElementListReference and flushes all the events on that list.  All it guaruntees is
  923. ; * that any events that made it to this layer before the time of the flush call will be flushed and
  924. ; * it will not flush any events that make it to this layer after the time when the call has returned.
  925. ; * What happens to events that occur during the flush is undefined.
  926. ; *
  927. ; *
  928. ; * Return Codes
  929. ; * paramErr
  930. ; *
  931.  
  932. ;
  933. ; extern OSStatus ISpElementList_Flush(ISpElementListReference inElementList)
  934. ;
  935.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION ISpElementList_Flush
  937.     ENDIF
  938.  
  939. ; *
  940. ; * ISpTimeToMicroseconds
  941. ; *
  942. ; *
  943. ; * This function takes time from an input sprocket event and converts it
  944. ; * into microseconds. (Version 1.2 or later of InputSprocket.)
  945. ; *
  946. ; *
  947. ; * Return Codes
  948. ; * paramErr
  949. ; *
  950.  
  951. ;
  952. ; extern OSStatus ISpTimeToMicroseconds(const AbsoluteTime *inTime, UnsignedWide *outMicroseconds)
  953. ;
  954.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  955.         IMPORT_CFM_FUNCTION ISpTimeToMicroseconds
  956.     ENDIF
  957.  
  958.     ENDIF    ; TARGET_RT_MAC_CFM
  959.  
  960.  
  961.  
  962.  
  963.     ENDIF ; __INPUTSPROCKET__ 
  964.  
  965.